#include "DefaultShortcuts.h"

const QHash<QString, Shortcut> &getDefaultShortcuts()
{
    static const QHash<QString, Shortcut> defaultShortcuts = {

        // General
        { "General.seek",
          { { Qt::Key_S }, QT_TRANSLATE_NOOP("MainWindow", "Seek"), "MainWindow" } },
        { "General.seekToFunctionEnd",
          { { Qt::Key_Dollar },
            QT_TRANSLATE_NOOP("MainWindow", "Seek to Function End"),
            "MainWindow" } },
        { "General.seekToFunctionStart",
          { { Qt::Key_AsciiCircum },
            QT_TRANSLATE_NOOP("MainWindow", "Seek to Function Start"),
            "MainWindow" } },
        { "General.refreshContents",
          { { Qt::CTRL | Qt::Key_R },
            QT_TRANSLATE_NOOP("MainWindow", "Refresh Contents"),
            "MainWindow" } },
        { "General.back",
          { QKeySequence::keyBindings(QKeySequence::Back),
            QT_TRANSLATE_NOOP("MainWindow", "Undo Seek"), "MainWindow" } },
        { "General.forward",
          { QKeySequence::keyBindings(QKeySequence::Forward),
            QT_TRANSLATE_NOOP("MainWindow", "Redo Seek"), "MainWindow" } },
        { "General.showFilter",
          { QKeySequence::keyBindings(QKeySequence::Find),
            QT_TRANSLATE_NOOP("MainWindow", "Show Filter"), "MainWindow" } },
        { "General.clearFilter",
          { { Qt::Key_Escape }, QT_TRANSLATE_NOOP("MainWindow", "Clear Filter"), "MainWindow" } },
        { "General.zoomIn",
          { { Qt::CTRL | Qt::Key_Plus, Qt::CTRL | Qt::SHIFT | Qt::Key_Plus },
            QT_TRANSLATE_NOOP("CutterGraphView", "Zoom In"),
            "CutterGraphView" } },
        { "General.zoomOut",
          { { Qt::CTRL | Qt::Key_Minus },
            QT_TRANSLATE_NOOP("CutterGraphView", "Zoom Out"),
            "CutterGraphView" } },
        { "General.zoomReset",
          { { Qt::CTRL | Qt::Key_Equal },
            QT_TRANSLATE_NOOP("CutterGraphView", "Reset Zoom"),
            "CutterGraphView" } },
        { "General.addComment",
          { { Qt::Key_Semicolon },
            QT_TRANSLATE_NOOP("AddressableItemContextMenu", "Add comment"),
            "AddressableItemContextMenu" } },
        { "General.showXRefs",
          { { Qt::Key_X },
            QT_TRANSLATE_NOOP("AddressableItemContextMenu", "Show X-Refs"),
            "AddressableItemContextMenu" } },
        { "General.copyAddress",
          { { Qt::CTRL | Qt::SHIFT | Qt::Key_C },
            QT_TRANSLATE_NOOP("AddressableItemContextMenu", "Copy address"),
            "AddressableItemContextMenu" } },
        { "General.seekPrev",
          { { Qt::Key_Escape },
            QT_TRANSLATE_NOOP("DecompilerWidget", "Seek to Previous Address"),
            "DecompilerWidget" } },

        // Breakpoint
        { "Breakpoint.delBreakpoint",
          { { Qt::Key_Delete },
            QT_TRANSLATE_NOOP("BreakpointWidget", "Delete breakpoint"),
            "BreakpointWidget" } },
        { "Breakpoint.toggleBreakpoint",
          { { Qt::Key_Space },
            QT_TRANSLATE_NOOP("BreakpointWidget", "Toggle breakpoint"),
            "BreakpointWidget" } },

        // Console
        { "Console.focusConsole",
          { { Qt::Key_Period },
            QT_TRANSLATE_NOOP("MainWindow", "Focus Console Input"),
            "MainWindow" } },
        { "Console.toggle",
          { { Qt::CTRL | Qt::Key_QuoteLeft, Qt::Key_Colon },
            QT_TRANSLATE_NOOP("ConsoleWidget", "Toggle Console Window"),
            "ConsoleWidget" } },
        { "Console.clear",
          { { Qt::CTRL | Qt::Key_L },
            QT_TRANSLATE_NOOP("ConsoleWidget", "Clear Output"),
            "ConsoleWidget" } },
        { "Console.clearRzInputLineEdit",
          { { Qt::Key_Escape },
            QT_TRANSLATE_NOOP("ConsoleWidget", "Clear Input"),
            "ConsoleWidget" } },
        { "Console.clearDebugee",
          { { Qt::Key_Escape },
            QT_TRANSLATE_NOOP("ConsoleWidget", "Clear Debugee"),
            "ConsoleWidget" } },
        { "Console.historyUp",
          { { Qt::Key_Up },
            QT_TRANSLATE_NOOP("ConsoleWidget", "Previous Command"),
            "ConsoleWidget" } },
        { "Console.historyDown",
          { { Qt::Key_Down },
            QT_TRANSLATE_NOOP("ConsoleWidget", "Next Command"),
            "ConsoleWidget" } },
        { "Console.complete",
          { { Qt::Key_Tab },
            QT_TRANSLATE_NOOP("ConsoleWidget", "Auto-Complete"),
            "ConsoleWidget" } },

        // Debug
        { "Debug.start",
          { { Qt::Key_F9 }, QT_TRANSLATE_NOOP("DebugActions", "Start debug"), "DebugActions" } },
        { "Debug.continue",
          { { Qt::Key_F5 }, QT_TRANSLATE_NOOP("DebugActions", "Continue"), "DebugActions" } },
        { "Debug.continueBack",
          { { Qt::CTRL | Qt::Key_F5 },
            QT_TRANSLATE_NOOP("DebugActions", "Continue backwards"),
            "DebugActions" } },
        { "Debug.step",
          { { Qt::Key_F7 }, QT_TRANSLATE_NOOP("DebugActions", "Step"), "DebugActions" } },
        { "Debug.stepOver",
          { { Qt::Key_F8 }, QT_TRANSLATE_NOOP("DebugActions", "Step over"), "DebugActions" } },
        { "Debug.stepOut",
          { { Qt::CTRL | Qt::Key_F8 },
            QT_TRANSLATE_NOOP("DebugActions", "Step out"),
            "DebugActions" } },
        { "Debug.stepBack",
          { { Qt::CTRL | Qt::Key_F7 },
            QT_TRANSLATE_NOOP("DebugActions", "Step backwards"),
            "DebugActions" } },
        { "Debug.accept",
          { { QKeySequence(Qt::CTRL | Qt::Key_Return) },
            QT_TRANSLATE_NOOP("NativeDebugDialog", "Accept Dialog"),
            "NativeDebugDialog" } },
        { "Debug.toggleBreakpoint",
          { { Qt::Key_F2, Qt::CTRL | Qt::Key_B },
            QT_TRANSLATE_NOOP("DecompilerContextMenu", "Add/remove breakpoint"),
            "DecompilerContextMenu" } },
        { "Debug.advancedBreakpoint",
          { { Qt::CTRL | Qt::Key_F2 },
            QT_TRANSLATE_NOOP("DecompilerContextMenu", "Advanced breakpoint"),
            "DecompilerContextMenu" } },

        // Decompiler
        { "Decompiler.copy",
          { QKeySequence::keyBindings(QKeySequence::Copy),
            QT_TRANSLATE_NOOP("DecompilerContextMenu", "Copy"), "DecompilerContextMenu" } },
        { "Decompiler.copyReferenceAddress",
          { { Qt::KeyboardModifier::ControlModifier | Qt::KeyboardModifier::ShiftModifier
              | Qt::Key_C },
            QT_TRANSLATE_NOOP("DecompilerContextMenu", "Copy address of [flag] (<address>)"),
            "DecompilerContextMenu" } },
        { "Decompiler.renameThingHere",
          { { Qt::Key_N },
            QT_TRANSLATE_NOOP("DecompilerContextMenu", "Rename function at cursor"),
            "DecompilerContextMenu" } },
        { "Decompiler.editFunctionVariables",
          { { Qt::Key_Y },
            QT_TRANSLATE_NOOP("DecompilerContextMenu", "Edit variable <name of variable>"),
            "DecompilerContextMenu" } },

        // Disassembly
        { "Disassembly.copy",
          { QKeySequence::keyBindings(QKeySequence::Copy),
            QT_TRANSLATE_NOOP("DisassemblyContextMenu", "Copy"), "DisassemblyContextMenu" } },
        { "Disassembly.copyInstructionBytes",
          { { Qt::CTRL | Qt::ALT | Qt::Key_C },
            QT_TRANSLATE_NOOP("DisassemblyContextMenu", "Copy instruction bytes"),
            "DisassemblyContextMenu" } },
        { "Disassembly.retypeLocals",
          { { Qt::Key_Y },
            QT_TRANSLATE_NOOP("DisassemblyContextMenu", "Re-type Local Variables"),
            "DisassemblyContextMenu" } },
        { "Disassembly.editFunction",
          { { Qt::SHIFT | Qt::Key_P },
            QT_TRANSLATE_NOOP("DisassemblyContextMenu", "Edit function"),
            "DisassemblyContextMenu" } },
        { "Disassembly.undefineFunction",
          { { Qt::Key_U },
            QT_TRANSLATE_NOOP("DisassemblyContextMenu", "Undefine function"),
            "DisassemblyContextMenu" } },
        { "Disassembly.defineFunction",
          { { Qt::Key_P },
            QT_TRANSLATE_NOOP("DisassemblyContextMenu", "Define function here"),
            "DisassemblyContextMenu" } },
        { "Disassembly.XRefsForVariables",
          { { QKeySequence(Qt::SHIFT | Qt::Key_X) },
            QT_TRANSLATE_NOOP("DisassemblyContextMenu", "X-Refs for local variables"),
            "DisassemblyContextMenu" } },
        { "Disassembly.rename",
          { { Qt::Key_N },
            QT_TRANSLATE_NOOP("DisassemblyContextMenu", "Rename or add flag"),
            "DisassemblyContextMenu" } },
        { "Disassembly.globalVariable",
          { { Qt::Key_G },
            QT_TRANSLATE_NOOP("DisassemblyContextMenu", "Modify or add global variable"),
            "DisassemblyContextMenu" } },
        { "Disassembly.setToCode",
          { { Qt::Key_C },
            QT_TRANSLATE_NOOP("DisassemblyContextMenu", "Code"),
            "DisassemblyContextMenu" } },
        { "Disassembly.setAsString",
          { { Qt::Key_A },
            QT_TRANSLATE_NOOP("DisassemblyContextMenu", "Auto-detect"),
            "DisassemblyContextMenu" } },
        { "Disassembly.setAsStringAdvanced",
          { { Qt::SHIFT | Qt::Key_A },
            QT_TRANSLATE_NOOP("DisassemblyContextMenu", "Advanced"),
            "DisassemblyContextMenu" } },
        { "Disassembly.setToDataEx",
          { { Qt::Key_Asterisk },
            QT_TRANSLATE_NOOP("DisassemblyContextMenu", "Set To Data Advanced"),
            "DisassemblyContextMenu" } },
        { "Disassembly.setToData",
          { { Qt::Key_D },
            QT_TRANSLATE_NOOP("DisassemblyContextMenu", "Switch Data"),
            "DisassemblyContextMenu" } },
        { "Disassembly.switchToGraph",
          { { Qt::Key_Space },
            QT_TRANSLATE_NOOP("DisassemblyWidget", "Switch to Graph"),
            "DisassemblyWidget" } },
        { "Disassembly.moveDown",
          { QList<QKeySequence> { Qt::Key_J }
                    + QKeySequence::keyBindings(QKeySequence::MoveToNextLine),
            QT_TRANSLATE_NOOP("DisassemblyWidget", "Move Cursor Down"), "DisassemblyWidget" } },
        { "Disassembly.moveUp",
          { QList<QKeySequence> { Qt::Key_K }
                    + QKeySequence::keyBindings(QKeySequence::MoveToPreviousLine),
            QT_TRANSLATE_NOOP("DisassemblyWidget", "Move Cursor Up"), "DisassemblyWidget" } },
        { "Disassembly.pageDown",
          { QKeySequence::keyBindings(QKeySequence::MoveToNextPage),
            QT_TRANSLATE_NOOP("DisassemblyWidget", "Move Cursor Down By Page"),
            "DisassemblyWidget" } },
        { "Disassembly.pageUp",
          { QKeySequence::keyBindings(QKeySequence::MoveToPreviousPage),
            QT_TRANSLATE_NOOP("DisassemblyWidget", "Move Cursor Up By Page"),
            "DisassemblyWidget" } },

        // Exports
        { "Exports.toggle",
          { { Qt::SHIFT | Qt::Key_E },
            QT_TRANSLATE_NOOP("ExportsWidget", "Toggle Exports Window"),
            "ExportsWidget" } },

        // Functions
        { "Functions.rename",
          { { Qt::Key_N }, QT_TRANSLATE_NOOP("FunctionsWidget", "Rename"), "FunctionsWidget" } },

        // Graph
        { "Graph.takeTrue",
          { { Qt::Key_T },
            QT_TRANSLATE_NOOP("DisassemblerGraphView", "Take True Branch"),
            "DisassemblerGraphView" } },
        { "Graph.takeFalse",
          { { Qt::Key_F },
            QT_TRANSLATE_NOOP("DisassemblerGraphView", "Take False Branch"),
            "DisassemblerGraphView" } },
        { "Graph.nextInstr",
          { { Qt::Key_J },
            QT_TRANSLATE_NOOP("DisassemblerGraphView", "Next Instruction"),
            "DisassemblerGraphView" } },
        { "Graph.prevInstr",
          { { Qt::Key_K },
            QT_TRANSLATE_NOOP("DisassemblerGraphView", "Previous Instruction"),
            "DisassemblerGraphView" } },
        { "Graph.toggle",
          { { Qt::SHIFT | Qt::Key_G },
            QT_TRANSLATE_NOOP("GraphWidget", "Toggle Graph Window"),
            "GraphWidget" } },
        { "Graph.switchToDisassembly",
          { { Qt::Key_Space },
            QT_TRANSLATE_NOOP("GraphWidget", "Switch to Disassembly View"),
            "GraphWidget" } },

        // Hex
        { "Hex.copy",
          { QKeySequence::keyBindings(QKeySequence::Copy), QT_TRANSLATE_NOOP("HexWidget", "Copy"),
            "HexWidget" } },
        { "Hex.addFlag",
          { { Qt::Key_N }, QT_TRANSLATE_NOOP("HexWidget", "Add flag at address"), "HexWidget" } },
        { "Hex.addMark",
          { { Qt::Key_M }, QT_TRANSLATE_NOOP("HexWidget", "Add mark"), "HexWidget" } },

        // Imports
        { "Imports.toggle",
          { { Qt::SHIFT | Qt::Key_I },
            QT_TRANSLATE_NOOP("ImportsWidget", "Toggle Imports Window"),
            "ImportsWidget" } },

        // Omnibar
        { "Omnibar.clear",
          { { QKeySequence(Qt::Key_Escape) },
            QT_TRANSLATE_NOOP("Omnibar", "Clear Omnibar"),
            "Omnibar" } },

        // Graph Overview
        { "Overview.zoomIn",
          { { Qt::Key_Plus }, QT_TRANSLATE_NOOP("OverviewWidget", "Zoom In"), "OverviewWidget" } },
        { "Overview.zoomOut",
          { { Qt::Key_Minus },
            QT_TRANSLATE_NOOP("OverviewWidget", "Zoom Out"),
            "OverviewWidget" } },

        // Strings
        { "Strings.toggle",
          { { Qt::SHIFT | Qt::Key_F12 },
            QT_TRANSLATE_NOOP("StringsWidget", "Toggle Strings Window"),
            "StringsWidget" } },
    };
    return defaultShortcuts;
}
